﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace QuaManSys.OuterInfo
{
    public partial class Server : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["searchText"] != null)
            {
                if (Request.QueryString["searchText"].ToString().Trim().Length >= 0)
                {
                    SortedSet<string> infoScrList = new SortedSet<string>();
                    using (QuaManSysEntities context = new QuaManSysEntities())
                    {
                        var infoSrc = from c in context.OuterQualityInfo
                                      select c.informationSource;

                        foreach (var cc in infoSrc)
                        {
                            if (cc.ToString().Trim().Contains(Request.QueryString["searchText"].ToString().Trim()))
                                infoScrList.Add(cc.ToString());
                        }
                    }
                    string returnText = "";
                    foreach (var i in infoScrList)
                    {
                        returnText += i.ToString() + "\n";
                    }

                    Response.Write(returnText);
                }
            }
        }
    }
}